//
//  VRGCalendarView.h
//  Vurig
//
//  Created by in 't Veen Tjeerd on 5/8/12.
//  Copyright (c) 2012 Vurig Media. All rights reserved.
//
//  Modified by cyrusleung on 2014-06-19
//  1.调整了日历样式、汉化等
//  2.增加了农历和节假日显示

#import <UIKit/UIKit.h>
#import "UIColor+expanded.h"

#define kVRGCalendarViewBottomHeight 40
#define kVRGCalendarViewGridHeight 50
#define kVRGCalendarViewTopBarHeight 88
#define kVRGCalendarViewWidth HARDWARE_SCREEN_WIDTH
#define kVRGCalendarViewWeekDayHeight 44

//#define kVRGCalendarViewDayWidth 42.0
#define kVRGCalendarViewDayHeight (99 * 0.5)
#define kVRGCalendarViewDayWidth HARDWARE_SCREEN_WIDTH / 7.0f
//#define kVRGCalendarViewDayHeight HARDWARE_SCREEN_WIDTH / 7.0f

@protocol VRGCalendarViewDelegate;

@interface VRGCalendarView : UIView {

    
    BOOL isAnimating;
    BOOL prepAnimationPreviousMonth;
    BOOL prepAnimationNextMonth;

}

@property (nonatomic, assign) id <VRGCalendarViewDelegate> delegate;
@property (nonatomic, retain) NSDate *currentMonth;
@property (nonatomic, retain) UILabel *labelCurrentMonth;
WeakProperty UIButton *qiehuanBtn;
@property (nonatomic, retain) UIImageView *animationView_A;
@property (nonatomic, retain) UIImageView *animationView_B;
@property (nonatomic, retain) NSArray *markedDates;
@property (nonatomic, retain) NSArray *markedColors;
@property (nonatomic, getter = calendarHeight) float calendarHeight;
@property (nonatomic, retain, getter = selectedDate) NSDate *selectedDate;

-(void)selectDate:(NSInteger)date;
-(void)reset;

-(void)markDates:(NSArray *)dates;
-(void)markDates:(NSArray *)dates withColors:(NSArray *)colors;

-(void)showNextMonth;
-(void)showPreviousMonth;

-(NSInteger)numRows;
-(void)updateSize;
-(UIImage *)drawCurrentState;

@end

@protocol VRGCalendarViewDelegate <NSObject>

@optional
/**日历收收起*/
-(void)calendarView:(VRGCalendarView *)calendarView switchedToMonthWithTargetHeight:(float)targetHeight animated:(BOOL)animated;

/**日历中的日期选中时*/
-(void)calendarView:(VRGCalendarView *)calendarView dateSelected:(NSDate *)date;

/**点击今天按钮时*/
- (void)calendarView:(VRGCalendarView *)calendarView todayBtnDidClick:(UIButton *)todayBtn;

/**标题栏中的日期选择*/
- (void)calendarView:(VRGCalendarView *)calendarView dateOptionBtnDidClick:(UIButton *)todayBtn;

@end
